# students/schemas.py
from pydantic import BaseModel
from datetime import date
from typing import Optional

class StudentBase(BaseModel):
    student_id: str
    class_name: str
    student_name: str
    hometown: Optional[str] = None
    graduate_school: Optional[str] = None
    major: Optional[str] = None
    enrollment_date: Optional[date] = None
    graduation_date: Optional[date] = None
    education: Optional[str] = None
    advisor_id: Optional[str] = None
    age: Optional[int] = None
    sex: Optional[str] = None

class StudentCreate(StudentBase):
    pass

class StudentUpdate(StudentBase):
    pass

class Student(StudentBase):
    class Config:
        from_attributes = True